function UndoController(button) {
    this._button = button;
}

UndoController.prototype = {
    register: function(calendar) {
        var me = this;
        this._calendar = calendar;
        
        this._button.onClick(function() {
            me._calendar.undo();
        });

        this._calendar.onUndoStatusChange(function(allowUndo) {
            if(allowUndo) {
                me._button.show();
                me._button.setTitle(i18n('CALENDAR_UNDO_TIP'));
            }else{
                me._button.hide();
                me._button.setTitle(i18n('CALENDAR_CANNOT_UNDO_TIP'));

            }
        });

    }
};

